import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
	state: {
        lockExplain: {
            1: '日常维护',
            2: '工程安装',
            3: '维修'
        },
        recordType: {
            1: '远程开锁',
            2: '蓝牙开锁',
            3: '密码开锁',
            4: '卡开锁',
            5: '临时授权密钥开锁',
            6: '密码下发成功',
            7: '卡号下发成功',
            8: '卡号删除成功',
            9: '密码删除成功',
            10: '钥匙开锁'
        },
        roleList: [],   // 所有角色列表
        userInfo: {},
        menuList: [],   // 当前用户所有菜单列表

        availablePermission: [],    //当前用户可用的权限
	},
	mutations: {
        commitUser( state, info ){
            state.userInfo = info;
        },
        commitMenu( state, menu ){
            state.menuList = menu;
        },
        commitRoleList( state, roleList ){
            state.roleList = roleList;
        },
        commitAvailablePermission(state, list){
            state.availablePermission = list;
        }
	},
	actions: {

	}
})
